<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">

<head>
    <th:block th:include="common/common_head :: commonHeader('品质异常单详情')"/>
    <link th:href="@{/static/css/plugins/cropper/cropper.min.css}"
          rel="stylesheet">
    <style type="text/css">
        #formTable td {
            padding: 0;
            text-align: center;
            line-height: 34px;
            font-size: 14px;
        }

        #formTable {
            width: 76%;
            margin: auto;

        }

        .texts {
            text-align: left;
            margin-left: 50px;
            display: flex;
            margin-bottom: 10px
        }
    </style>

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <form class="form-horizontal" method="post" id="form0">
            <div class="form-group">
                <div class="col-sm-8" style="margin-left: 16px">
                    <button class="btn btn-primary" type="reset"
                            onclick="Dialog.closeFrame(window.name)">关 闭
                    </button>
                </div>
            </div>

            <table width="74%" class="layui-table" id="formTable">
                <tr>
                    <th height="80px" valign="middle" colspan="11"
                        style="text-align: center; vertical-align: middle; font-size: 21px;color: black">
                        <div style="position: absolute; width: 68px; height: 58px; margin-left: 10%; margin-top:-17px;">
                            <img alt="" th:src="@{/static/img/hsicon.png}"></div>
                        品 质 异 常 处 理 单
                        <div style="position: absolute; margin-left: 80%; margin-top:8px;font-size: 14px">
                            表单编号：<span th:text="${abnormalQualityEntity.formCode}"></span>
                        </div>
                    </th>
                </tr>
                <tr>
                    <td>责任单位：</td>
                    <td th:text="${abnormalQualityEntity.vendorCode}"></td>
                    <td>物料：</td>
                    <td colspan="2" th:text="${abnormalQualityEntity.materialCode}"></td>
                    <td>发文者：</td>
                    <td colspan="2" th:text="${abnormalQualityEntity.submit}"></td>
                    <td>发文日期：</td>
                    <td colspan="2" th:text="${#dates.format(abnormalQualityEntity.submitDate,'yyyy-MM-dd')}"></td>
                </tr>
                <tr>
                    <td colspan="2" th:text="${abnormalQualityEntity.vendorName}"></td>
                    <td style="line-height: 40px"> 物料描述：</td>
                    <td colspan="4" th:text="${abnormalQualityEntity.materialDesc}"></td>
                    <td>采购组：</td>
                    <td colspan="4" th:text="${abnormalQualityEntity.cgz}"></td>
                </tr>
                <tr>
                    <td colspan="11">
                        <div style="height: 40px; width: 18.2%; border-bottom: 1px solid gainsboro;border-right: 1px solid gainsboro;">
                            D1小组成员:
                        </div>
                        <span th:text="${abnormalQualityEntity.teamMember}"
                              style="display: flex;;margin-left:50px;"></span>
                        <div style="margin-left: 82%">组长：<span th:text="${abnormalQualityEntity.teamLeader}"></span>
                        </div>
                    </td>
                </tr>
                <tr style="height: 110px;">
                    <td colspan="11">
                        <div style="height: 46px; width:  18.15%; border-bottom: 1px solid gainsboro;border-right: 1px solid gainsboro;margin-bottom: 18px">
                            D2问题点描述:
                        </div>
                        <div th:text="${abnormalQualityEntity.description}" class="texts"></div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">附件</td>
                    <td colspan="9"><a id="sqeAttch" th:text="${abnormalQualityEntity.sqeAttach}"
                                       th:value="${abnormalQualityEntity.pkId}" onclick="dowloadFileById(this)"
                                       style="color: blue"></a>
                    </td>
                </tr>
                <tr>
                    <td width="9%">收获日期</td>
                    <td width="9%">采购凭证</td>
                    <td width="9%">供应商批次</td>
                    <td width="9%">厚声批次</td>
                    <td width="9%">缺陷项目</td>
                    <td width="9%">缺陷分类</td>
                    <td width="9%">不良率</td>
                    <td width="9%">不良数量</td>
                    <td width="9%">进科数量</td>
                    <td width="9%">厚声处理要求</td>
                    <td width="9%">备注</td>
                </tr>
                <tr style="height:40px">
                    <td width="9%" th:text="${#dates.format(abnormalQualityEntity.receiveDate,'yyyy-MM-dd')}"></td>
                    <td width="9%" th:text="${abnormalQualityEntity.purchaseVoucher}"></td>
                    <td width="9%" th:text="${abnormalQualityEntity.vendorBatch}"></td>
                    <td width="9%" th:text="${abnormalQualityEntity.hsBatch}"></td>
                    <td width="9%" th:text="${abnormalQualityEntity.defectiveItem}"></td>
                    <td width="9%" th:text="${abnormalQualityEntity.detectiveSort}"></td>
                    <td width="9%" th:text="${abnormalQualityEntity.defectRate}"></td>
                    <td width="9%" th:text="${abnormalQualityEntity.defectNumber}"></td>
                    <td width="9%" th:text="${abnormalQualityEntity.feedNumber}"></td>
                    <td width="9%" th:text="${abnormalQualityEntity.processDemand}"></td>
                    <td width="9%" th:text="${abnormalQualityEntity.remark}"></td>
                </tr>
                <tr>
                    <td colspan="11">
                        <div style="text-align: left;margin-left: 50px;height: 43px">要求：
                            &nbsp;<span th:text="${abnormalQualityEntity.require}"></span>
                        </div>

                    </td>
                </tr>
                <tr>
                    <td colspan="2">供应商上传附件</td>
                    <td colspan="9"><a id="vendorAttch" th:text="${abnormalQualityEntity.vendorAttach}"
                                       th:value="${abnormalQualityEntity.pkId}" onclick="dowloadVendorFileById(this)"
                                       style="color: blue"></a>
                    </td>
                </tr>
                <tr>
                    <td colspan="11">
                        <ul style="display: flex;justify-content: flex-start">
                            <li style="height:40px; width: 18.15%; border-bottom: 1px solid gainsboro;border-right: 1px solid gainsboro;">
                                D3原因分析（按5w要求）:
                            </li>
                            <li style="height:40px; width: 10%; border: 1px solid gainsboro;border-top:none;border-right:none;margin-left:460px">
                                要求完成日期：
                            </li>
                            <li style="height:40px; width: 19%; border: 1px solid gainsboro;border-top:none; border-right:none;"
                                th:text="${#dates.format(abnormalQualityEntity.d3DemandDate,'yyyy-MM-dd')}">

                            </li>
                            <li style="height:40px; width: 11%; border: 1px solid gainsboro;border-top:none;border-right:none;">
                                实际完成日期:
                            </li>

                            <li style="height:40px; width: 15%; border: 1px solid gainsboro;border-top:none;border-right:none;"
                                th:text="${#dates.format(abnormalQualityEntity. d3RealDate,'yyyy-MM-dd')}">

                            </li>
                        </ul>
                        <div th:text="${abnormalQualityEntity.d3Analyze}"
                             class="texts">

                        </div>

                        <div style="margin-left: 78%;line-height: 16px">
                            负责人：<span th:text="${abnormalQualityEntity.d3Fzr}"></span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="11">
                        <ul style="display: flex;justify-content: flex-start">
                            <li style="height:40px; width: 18.15%; border-bottom: 1px solid gainsboro;border-right: 1px solid gainsboro;">
                                D4不良品外流原因:
                            </li>
                            <li style="height:40px; width: 10%; border: 1px solid gainsboro;border-top:none;border-right:none;margin-left:460px">
                                要求完成日期：
                            </li>
                            <li style="height:40px; width: 19%; border: 1px solid gainsboro;border-top:none; border-right:none;"
                                th:text="${#dates.format(abnormalQualityEntity.d4DemandDate,'yyyy-MM-dd')}">

                            </li>
                            <li style="height:40px; width: 11%; border: 1px solid gainsboro;border-top:none;border-right:none;">
                                实际完成日期:
                            </li>

                            <li style="height:40px; width: 15%; border: 1px solid gainsboro;border-top:none;border-right:none;"
                                th:text="${#dates.format(abnormalQualityEntity.d4RealDate,'yyyy-MM-dd')}">

                            </li>
                        </ul>
                        <div th:text="${abnormalQualityEntity.d4Outflow}" class="texts">

                        </div>

                        <div style="margin-left: 78%;line-height: 16px">
                            负责人：<span th:text="${abnormalQualityEntity.d4Fzr}"></span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="11">
                        <ul style="display: flex;justify-content: flex-start">
                            <li style="height:40px; width: 18.15%; border-bottom: 1px solid gainsboro;border-right: 1px solid gainsboro;">
                                D5短期对策:
                            </li>
                            <li style="height:40px; width: 10%; border: 1px solid gainsboro;border-top:none;border-right:none;margin-left:460px">
                                要求完成日期：
                            </li>
                            <li style="height:40px; width: 19%; border: 1px solid gainsboro;border-top:none; border-right:none;"
                                th:text="${#dates.format(abnormalQualityEntity.d5DemandDate,'yyyy-MM-dd')}">

                            </li>
                            <li style="height:40px; width: 11%; border: 1px solid gainsboro;border-top:none;border-right:none;">
                                实际完成日期:
                            </li>

                            <li style="height:40px; width: 15%; border: 1px solid gainsboro;border-top:none;border-right:none;"
                                th:text="${#dates.format(abnormalQualityEntity.d5RealDate,'yyyy-MM-dd')}">

                            </li>
                        </ul>
                        <div th:text="${abnormalQualityEntity.d5CurrPlan}" class="texts">

                        </div>

                        <div style="margin-left: 78%;line-height: 16px">
                            负责人：<span th:text="${abnormalQualityEntity.d5Fzr}"></span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="11">
                        <ul style="display: flex;justify-content: flex-start">
                            <li style="height:40px; width: 18.15%; border-bottom: 1px solid gainsboro;border-right: 1px solid gainsboro;">
                                D6长期对策:
                            </li>
                            <li style="height:40px; width: 10%; border: 1px solid gainsboro;border-top:none;border-right:none;margin-left:460px">
                                要求完成日期：
                            </li>
                            <li style="height:40px; width: 19%; border: 1px solid gainsboro;border-top:none; border-right:none;"
                                th:text="${#dates.format(abnormalQualityEntity.d6DemandDate,'yyyy-MM-dd')}">

                            </li>
                            <li style="height:40px; width: 11%; border: 1px solid gainsboro;border-top:none;border-right:none;">
                                实际完成日期:
                            </li>

                            <li style="height:40px; width: 15%; border: 1px solid gainsboro;border-top:none;border-right:none;"
                                th:text="${#dates.format(abnormalQualityEntity.d6RealDate,'yyyy-MM-dd')}">

                            </li>
                        </ul>
                        <div th:text="${abnormalQualityEntity.d6LongPlan}" class="texts">

                        </div>

                        <div style="margin-left: 76%;line-height: 16px">
                            负责人：<span th:text="${abnormalQualityEntity.d6Fzr}"></span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="11">
                        <ul style="display: flex;justify-content: flex-start">
                            <li style="height:40px; width: 18.15%; border-bottom: 1px solid gainsboro;border-right: 1px solid gainsboro;">
                                D7改善效果追踪:
                            </li>
                            <li style="height:40px; width: 10%; border: 1px solid gainsboro;border-top:none;border-right:none;margin-left:460px">
                                计划完成日期：

                            </li>
                            <li style="height:40px; width: 19%; border: 1px solid gainsboro;border-top:none; border-right:none;"
                                th:text="${#dates.format(abnormalQualityEntity.d7PlanDate,'yyyy-MM-dd')}">

                            </li>
                            <li style="height:40px; width: 11%; border: 1px solid gainsboro;border-top:none;border-right:none;">
                                实际完成日期:

                            </li>

                            <li style="height:40px; width: 15%; border: 1px solid gainsboro;border-top:none;border-right:none;"
                                th:text="${#dates.format(abnormalQualityEntity.d7RealDate,'yyyy-MM-dd')}">

                            </li>

                        </ul>
                        <div th:text="${abnormalQualityEntity.d7ResultTrack}" class="texts">

                        </div>
                        <div style="margin-left: 78%;line-height: 16px">
                            QE主管：<span th:text="${abnormalQualityEntity.d7Director}"></span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="11">
                        <ul style="display: flex;justify-content: flex-start">
                            <li style="height:40px; width: 18.15%; border-bottom: 1px solid gainsboro;border-right: 1px solid gainsboro;">
                                D8标准化作业培训:
                            </li>
                            <li style="height:40px; width: 11%; border: 1px solid gainsboro;border-top:none;border-right:none;margin-left:460px">
                                计划完成日期：
                            </li>
                            <li style="height:40px; width: 19%; border: 1px solid gainsboro;border-top:none; border-right:none;"
                                th:text="${#dates.format(abnormalQualityEntity.d8PlanDate,'yyyy-MM-dd')}">

                            </li>
                            <li style="height:40px; width: 11%; border: 1px solid gainsboro;border-top:none;border-right:none;">
                                实际完成日期:

                            </li>

                            <li style="height:40px; width: 15%; border: 1px solid gainsboro;border-top:none;border-right:none;"
                                th:text="${#dates.format(abnormalQualityEntity. d8RealDate,'yyyy-MM-dd')}">

                            </li>

                        </ul>
                        <div th:text="${abnormalQualityEntity.d8StandardWork}" class="texts">

                        </div>

                        <div style="margin-left: 78%;line-height: 16px">
                            QE主管：<span th:text="${abnormalQualityEntity.d8Director}"></span>
                        </div>
                    </td>
                </tr>
            </table>

        </form>
    </div>
</div>

<!--引入公共js-->
<div th:include="common/onload_js :: onloadJS"></div>
<!-- Chosen -->
<script th:src="@{/static/js/plugins/chosen/chosen.jquery.js}"></script>
<script type="text/javascript">
    //附件名称截取
    $(function () {
        var sqe = $("#sqeAttch").text();
        sub(sqe, sqeAttch);
        var vendor = $("#vendorAttch").text();
        sub(vendor, vendorAttch);
    });

    //截取文件名称
    function sub(sqe, selector) {
        var suffix = sqe.substr(sqe.lastIndexOf("."));
        var prefix = sqe.substring(0, sqe.indexOf("_")).trim();
        prefix = prefix.substr(sqe.lastIndexOf("/") + 1);
        var attach = prefix + suffix;
        $(selector).text(attach);
    }

    /**
     **根据pkid下载报告文件
     **
     **/
    function dowloadFileById(obj) {
        var id = $(obj).first().attr("value");
        window.location.href = ctxPath + "/abnormalQuality/downloadFileById?id=" + id;
    }

    /**
     **根据pkid下载供应商报告文件
     **
     **/
    function dowloadVendorFileById(obj) {
        var id = $(obj).first().attr("value");
        window.location.href = ctxPath + "/abnormalQuality/downloadVendorFileById?id=" + id;
    }
</script>


</body>
</html>
